home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 9895 < prev    next >
Mailbox/MIME Entity  |  1996-08-05  |  1.8 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: Mailbox/MIME Entity (archive/mbox).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert Mailbox/MIME Entity (archive/mbox) magic Supported
1% dexvert Text File (text/txt) fallback Supported
100% file C source, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/950 MIME Email (1.0) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 4e 65 77 73 67 72 6f 75 | 70 73 3a 20 63 6f 6d 70 |Newsgrou|ps: comp|
|00000010| 2e 6c 61 6e 67 2e 63 2b | 2b 0a 50 61 74 68 3a 20 |.lang.c+|+.Path: |
|00000020| 75 73 65 6e 65 74 2e 65 | 65 6c 2e 75 66 6c 2e 65 |usenet.e|el.ufl.e|
|00000030| 64 75 21 77 61 72 77 69 | 63 6b 21 6e 6f 74 74 2d |du!warwi|ck!nott-|
|00000040| 63 73 21 74 72 65 6e 74 | 2d 64 6f 63 21 6e 65 77 |cs!trent|-doc!new|
|00000050| 73 0a 46 72 6f 6d 3a 20 | 43 48 41 4d 42 45 52 53 |s.From: |CHAMBERS|
|00000060| 20 4a 61 73 6f 6e 20 3c | 70 74 33 63 68 61 6a 3e | Jason <|pt3chaj>|
|00000070| 0a 53 75 62 6a 65 63 74 | 3a 20 52 65 3a 20 43 20 |.Subject|: Re: C |
|00000080| 63 6f 64 65 20 69 6e 20 | 61 20 43 2b 2b 20 61 70 |code in |a C++ ap|
|00000090| 70 0a 58 2d 4e 6e 74 70 | 2d 50 6f 73 74 69 6e 67 |p.X-Nntp|-Posting|
|000000a0| 2d 48 6f 73 74 3a 20 70 | 75 70 31 37 0a 43 6f 6e |-Host: p|up17.Con|
|000000b0| 74 65 6e 74 2d 54 79 70 | 65 3a 20 74 65 78 74 2f |tent-Typ|e: text/|
|000000c0| 70 6c 61 69 6e 3b 20 63 | 68 61 72 73 65 74 3d 75 |plain; c|harset=u|
|000000d0| 73 2d 61 73 63 69 69 0a | 4d 65 73 73 61 67 65 2d |s-ascii.|Message-|
|000000e0| 49 44 3a 20 3c 44 6e 72 | 35 73 77 2e 4b 49 6e 40 |ID: <Dnr|5sw.KIn@|
|000000f0| 64 6f 63 2e 6e 74 75 2e | 61 63 2e 75 6b 3e 0a 54 |doc.ntu.|ac.uk>.T|
|00000100| 6f 3a 20 74 68 6f 6d 61 | 73 68 40 77 61 72 70 31 |o: thoma|sh@warp1|
|00000110| 30 2e 73 6d 61 72 74 6c | 69 6e 6b 2e 6e 65 74 0a |0.smartl|ink.net.|
|00000120| 53 65 6e 64 65 72 3a 20 | 6e 65 77 73 40 64 6f 63 |Sender: |news@doc|
|00000130| 2e 6e 74 75 2e 61 63 2e | 75 6b 0a 43 6f 6e 74 65 |.ntu.ac.|uk.Conte|
|00000140| 6e 74 2d 54 72 61 6e 73 | 66 65 72 2d 45 6e 63 6f |nt-Trans|fer-Enco|
|00000150| 64 69 6e 67 3a 20 37 62 | 69 74 0a 4f 72 67 61 6e |ding: 7b|it.Organ|
|00000160| 69 7a 61 74 69 6f 6e 3a | 20 54 68 65 20 4e 6f 74 |ization:| The Not|
|00000170| 74 69 6e 67 68 61 6d 20 | 54 72 65 6e 74 20 55 6e |tingham |Trent Un|
|00000180| 69 76 65 72 73 69 74 79 | 2c 20 44 4f 43 2e 0a 52 |iversity|, DOC..R|
|00000190| 65 66 65 72 65 6e 63 65 | 73 3a 20 3c 34 68 37 74 |eference|s: <4h7t|
|000001a0| 34 33 24 36 61 73 40 66 | 72 6f 64 6f 2e 73 6d 61 |43$6as@f|rodo.sma|
|000001b0| 72 74 6c 69 6e 6b 2e 6e | 65 74 3e 0a 4d 69 6d 65 |rtlink.n|et>.Mime|
|000001c0| 2d 56 65 72 73 69 6f 6e | 3a 20 31 2e 30 0a 44 61 |-Version|: 1.0.Da|
|000001d0| 74 65 3a 20 4d 6f 6e 2c | 20 34 20 4d 61 72 20 31 |te: Mon,| 4 Mar 1|
|000001e0| 39 39 36 20 31 36 3a 35 | 38 3a 30 38 20 47 4d 54 |996 16:5|8:08 GMT|
|000001f0| 0a 58 2d 4d 61 69 6c 65 | 72 3a 20 4d 6f 7a 69 6c |.X-Maile|r: Mozil|
|00000200| 6c 61 20 31 2e 31 4e 20 | 28 58 31 31 3b 20 49 3b |la 1.1N |(X11; I;|
|00000210| 20 53 75 6e 4f 53 20 34 | 2e 31 2e 32 20 73 75 6e | SunOS 4|.1.2 sun|
|00000220| 34 63 29 0a 58 2d 55 72 | 6c 3a 20 6e 65 77 73 3a |4c).X-Ur|l: news:|
|00000230| 34 68 37 74 34 33 24 36 | 61 73 40 66 72 6f 64 6f |4h7t43$6|as@frodo|
|00000240| 2e 73 6d 61 72 74 6c 69 | 6e 6b 2e 6e 65 74 0a 0a |.smartli|nk.net..|
|00000250| 59 6f 75 20 73 68 6f 75 | 6c 64 20 62 65 20 61 62 |You shou|ld be ab|
|00000260| 6c 65 20 74 6f 20 63 6f | 6d 70 69 6c 65 20 43 20 |le to co|mpile C |
|00000270| 63 6f 64 65 20 75 73 69 | 6e 67 20 61 20 43 2b 2b |code usi|ng a C++|
|00000280| 20 63 6f 6d 70 69 6c 65 | 72 2e 20 54 68 69 73 20 | compile|r. This |
|00000290| 73 74 65 6d 73 20 66 72 | 6f 6d 20 74 68 65 0a 65 |stems fr|om the.e|
|000002a0| 61 72 6c 79 20 64 61 79 | 73 20 77 68 65 72 65 20 |arly day|s where |
|000002b0| 43 2b 2b 20 63 6f 6d 70 | 69 6c 65 72 73 20 65 73 |C++ comp|ilers es|
|000002c0| 73 65 6e 74 69 61 6c 6c | 79 20 63 6f 6e 76 65 72 |sentiall|y conver|
|000002d0| 74 65 64 20 69 74 73 20 | 69 6e 70 75 74 20 74 6f |ted its |input to|
|000002e0| 20 43 20 73 6f 75 72 63 | 65 2c 20 74 6f 0a 62 65 | C sourc|e, to.be|
|000002f0| 20 70 61 73 73 65 64 20 | 74 6f 20 74 68 65 20 43 | passed |to the C|
|00000300| 20 63 6f 6d 70 69 6c 65 | 72 2e 20 4d 61 79 62 65 | compile|r. Maybe|
|00000310| 2c 20 74 68 65 20 63 6f | 6d 70 69 6c 61 74 69 6f |, the co|mpilatio|
|00000320| 6e 20 65 72 72 6f 72 73 | 20 79 6f 75 20 61 72 65 |n errors| you are|
|00000330| 20 67 65 74 74 69 6e 67 | 20 61 72 65 0a 64 75 65 | getting| are.due|
|00000340| 20 74 6f 20 6e 6f 6e 2d | 70 6f 72 74 61 62 6c 65 | to non-|portable|
|00000350| 20 63 6f 64 65 20 61 6e | 64 20 6e 6f 74 68 69 6e | code an|d nothin|
|00000360| 67 20 74 6f 20 64 6f 20 | 77 69 74 68 20 74 68 65 |g to do |with the|
|00000370| 20 66 61 63 74 20 74 68 | 61 74 20 79 6f 75 20 61 | fact th|at you a|
|00000380| 72 65 20 63 6f 6d 70 69 | 6c 69 6e 67 0a 75 73 69 |re compi|ling.usi|
|00000390| 6e 67 20 61 20 43 2b 2b | 20 63 6f 6d 70 69 6c 65 |ng a C++| compile|
|000003a0| 72 2e 20 50 65 72 68 61 | 70 73 20 79 6f 75 72 20 |r. Perha|ps your |
|000003b0| 6f 72 69 67 69 6e 61 6c | 20 43 20 63 6f 64 65 20 |original| C code |
|000003c0| 63 6f 6e 66 6f 72 6d 73 | 20 74 6f 20 74 68 65 20 |conforms| to the |
|000003d0| 4b 26 52 20 73 74 61 6e | 64 61 72 64 0a 28 69 2e |K&R stan|dard.(i.|
|000003e0| 65 2e 20 6e 6f 20 70 72 | 6f 74 6f 74 79 70 65 73 |e. no pr|ototypes|
|000003f0| 29 2c 20 72 61 74 68 65 | 72 20 74 68 61 6e 20 74 |), rathe|r than t|
|00000400| 68 65 20 41 4e 53 49 20 | 73 74 61 6e 64 61 72 64 |he ANSI |standard|
|00000410| 2e 20 4f 72 20 6d 61 79 | 62 65 20 79 6f 75 72 20 |. Or may|be your |
|00000420| 43 20 63 6f 64 65 20 69 | 73 0a 64 65 70 65 6e 64 |C code i|s.depend|
|00000430| 65 6e 74 20 6f 6e 20 73 | 6f 6d 65 20 4d 41 43 20 |ent on s|ome MAC |
|00000440| 6c 69 62 72 61 72 79 20 | 77 68 69 63 68 20 69 73 |library |which is|
|00000450| 20 75 6e 61 76 61 69 6c | 61 62 6c 65 20 6f 6e 20 | unavail|able on |
|00000460| 74 68 65 20 50 43 2e 20 | 28 49 20 61 6d 20 73 6f |the PC. |(I am so|
|00000470| 72 72 79 20 62 75 74 0a | 74 68 65 20 4d 41 43 20 |rry but.|the MAC |
|00000480| 69 73 20 6f 6e 65 20 6f | 66 20 74 68 65 20 66 65 |is one o|f the fe|
|00000490| 77 20 70 6c 61 74 66 6f | 72 6d 73 20 49 20 68 61 |w platfo|rms I ha|
|000004a0| 76 65 20 70 72 6f 67 72 | 61 6d 6d 65 64 20 66 6f |ve progr|ammed fo|
|000004b0| 72 29 2e 20 57 68 61 74 | 65 76 65 72 2c 20 74 68 |r). What|ever, th|
|000004c0| 65 0a 70 72 6f 62 6c 65 | 6d 2c 20 79 6f 75 20 6d |e.proble|m, you m|
|000004d0| 61 79 20 68 61 76 65 20 | 74 6f 20 6d 61 6b 65 20 |ay have |to make |
|000004e0| 28 6d 69 6e 6f 72 29 20 | 65 64 69 74 73 20 74 6f |(minor) |edits to|
|000004f0| 20 79 6f 75 20 43 20 63 | 6f 64 65 2e 0a 0a 46 6f | you C c|ode...Fo|
|00000500| 72 20 65 78 61 6d 70 6c | 65 2c 20 74 6f 20 62 65 |r exampl|e, to be|
|00000510| 20 61 62 6c 65 20 74 6f | 20 63 61 6c 6c 20 43 20 | able to| call C |
|00000520| 66 72 6f 6d 20 43 2b 2b | 2c 20 79 6f 75 20 6e 65 |from C++|, you ne|
|00000530| 65 64 20 74 6f 20 65 6e | 63 6c 6f 73 65 20 74 68 |ed to en|close th|
|00000540| 65 20 43 0a 64 65 63 6c | 61 72 61 74 69 6f 6e 73 |e C.decl|arations|
|00000550| 20 61 73 20 66 6f 6c 6c | 6f 77 73 3a 0a 0a 65 78 | as foll|ows:..ex|
|00000560| 74 65 72 6e 20 22 43 22 | 20 7b 0a 0a 76 6f 69 64 |tern "C"| {..void|
|00000570| 20 6d 79 43 46 75 6e 63 | 31 20 28 69 6e 74 2c 20 | myCFunc|1 (int, |
|00000580| 69 6e 74 29 3b 0a 76 6f | 69 64 20 6d 79 43 66 75 |int);.vo|id myCfu|
|00000590| 6e 63 32 20 28 66 6c 6f | 61 74 29 3b 0a 0a 2f 2a |nc2 (flo|at);../*|
|000005a0| 20 65 74 63 2e 20 2a 2f | 0a 0a 7d 0a 0a 49 66 20 | etc. */|..}..If |
|000005b0| 79 6f 75 20 77 69 73 68 | 20 74 6f 20 63 6f 6e 74 |you wish| to cont|
|000005c0| 69 6e 75 65 20 75 73 69 | 6e 67 20 79 6f 75 72 20 |inue usi|ng your |
|000005d0| 43 20 66 75 6e 63 74 69 | 6f 6e 73 20 66 72 6f 6d |C functi|ons from|
|000005e0| 20 61 20 43 20 70 72 6f | 67 72 61 6d 2c 20 79 6f | a C pro|gram, yo|
|000005f0| 75 0a 77 6f 75 6c 64 20 | 64 6f 20 73 6f 6d 65 74 |u.would |do somet|
|00000600| 68 69 6e 67 20 6c 69 6b | 65 20 28 74 68 69 73 20 |hing lik|e (this |
|00000610| 69 73 20 6d 75 63 68 20 | 6d 6f 72 65 20 70 6f 72 |is much |more por|
|00000620| 74 61 62 6c 65 20 74 68 | 61 6e 20 61 62 6f 76 65 |table th|an above|
|00000630| 29 3a 0a 0a 23 69 66 64 | 65 66 20 5f 5f 63 70 6c |):..#ifd|ef __cpl|
|00000640| 75 73 70 6c 75 73 0a 65 | 78 74 65 72 6e 20 22 43 |usplus.e|xtern "C|
|00000650| 22 20 7b 0a 23 65 6e 64 | 69 66 20 2f 2a 20 5f 5f |" {.#end|if /* __|
|00000660| 63 70 6c 75 73 70 6c 75 | 73 20 2a 2f 0a 0a 76 6f |cplusplu|s */..vo|
|00000670| 69 64 20 6d 79 43 46 75 | 6e 63 20 28 69 6e 74 2c |id myCFu|nc (int,|
|00000680| 20 69 6e 74 29 3b 0a 76 | 6f 69 64 20 6d 79 43 66 | int);.v|oid myCf|
|00000690| 75 6e 63 32 20 28 66 6c | 6f 61 74 29 3b 0a 0a 2f |unc2 (fl|oat);../|
|000006a0| 2a 20 65 74 63 2e 20 2a | 2f 0a 0a 23 69 66 64 65 |* etc. *|/..#ifde|
|000006b0| 66 20 5f 5f 63 70 6c 75 | 73 70 6c 75 73 0a 7d 0a |f __cplu|splus.}.|
|000006c0| 23 65 6e 64 69 66 20 2f | 2a 20 5f 5f 63 70 6c 75 |#endif /|* __cplu|
|000006d0| 73 70 6c 75 73 2a 2f 0a | 0a 0a 4e 6f 74 65 3a 20 |splus*/.|..Note: |
|000006e0| 49 20 74 68 69 6e 6b 20 | 5f 5f 63 70 6c 75 73 70 |I think |__cplusp|
|000006f0| 6c 75 73 20 69 73 20 74 | 68 65 20 63 6f 72 72 65 |lus is t|he corre|
|00000700| 63 74 20 73 70 65 6c 6c | 69 6e 67 2e 20 53 65 65 |ct spell|ing. See|
|00000710| 20 53 74 72 6f 75 73 74 | 72 75 70 20 66 6f 72 20 | Stroust|rup for |
|00000720| 6d 6f 72 65 0a 64 65 74 | 61 69 6c 73 2e 0a 0a 48 |more.det|ails...H|
|00000730| 6f 70 65 20 74 68 69 73 | 20 68 65 6c 70 73 2e 0a |ope this| helps..|
|00000740| 0a | |. | |
+--------+-------------------------+-------------------------+--------+--------+